<form #loginForm="ngForm" class="form-horizontal" role="form" (ngSubmit)="submit()">
    <div class="form-group">
        <div class="col-sm-offset-4 col-sm-3">
            <div *ngIf="checkExistResult" class="alert alert-danger">
                用户名或密码错误
            </div>
        </div>
    </div>
    <div class="form-group">
        <label for="username" class="col-sm-offset-2 col-sm-2 control-label">用户名</label>
        <div class="col-sm-3">
            <input type="text" class="form-control" [(ngModel)]="user.username"
                   id="username" placeholder="请输入用户名" name="username"
                   required minlength="6" maxlength="12">
            <div *ngIf="formErrors.username" class="alert alert-danger">
                {{formErrors.username}}
            </div>
        </div>
    </div>
    <div class="form-group">
        <label for="password" class="col-sm-offset-2 col-sm-2 control-label">密码</label>
        <div class="col-sm-3">
            <input type="password" class="form-control" [(ngModel)]="user.password"
                   id="password" placeholder="请输入密码" name="password"
                   required minlength="6" maxlength="12">
            <div *ngIf="formErrors.password" class="alert alert-danger">
                {{formErrors.password}}
            </div>
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-4 col-sm-6">
            <div class="checkbox">
                <label>
                    <input type="checkbox">请记住我
                </label>
            </div>
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-4 col-sm-6">
            <button type="submit" class="btn btn-default">登录</button>
        </div>
    </div>
</form>